﻿using LMM_Editor.Classes.Behaviour;
using LMM_Editor.Classes.CustomControls;
using LMM_Editor.Classes.System;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace LMM_Editor.Classes.Entities
{
    public class IEntity
    {
        public int id;
        public Image image;
        public List<IEvent> events;
        public Control component;
        private Color origColor;
        public PropertyWrapper propertyWrapper;

        public IEntity()
        {
            List<IEvent> events = new List<IEvent>();
            component = null;
            image = null;
            origColor = Color.LightYellow;
        }


        public void select()
        {
            if (component != null)
            {
                CustomLabel c = (CustomLabel)component;
                origColor = c.BorderColor;

                component.Invalidate();
                Data.propertiesGrid.SelectedObject = propertyWrapper;
            }
        }

        public void deselect()
        {
            if (component != null)
            {
                CustomLabel c = (CustomLabel)component;
                c.BorderColor = origColor;
                component.Refresh();
            }
        }
    }
}
